//
//  MyAFNBlock.m
//  MedicalTip
//
//  Created by 徐潇 on 15/4/14.
//  Copyright (c) 2015年 徐潇. All rights reserved.
//

#import "MyAFNBlock.h"

@implementation MyAFNBlock


// block 第三步

+ (void)getDataWithString:(NSString *)str block:(myBlock)myBlock
{
    AFNetworkReachabilityManager *netWorkManager = [AFNetworkReachabilityManager sharedManager];
    NSString *url_string = [NSString stringWithString:str];
    AFHTTPRequestOperationManager* manager = [AFHTTPRequestOperationManager manager];
    manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"text/plain",@"text/json",@"application/json",@"text/javascript",@"text/html",nil];
    [manager GET:url_string parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
        [netWorkManager stopMonitoring];
        myBlock(responseObject);
        
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        
        NSLog(@"失败==== %@",error);
    }];

}
@end
